<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app">
			<h3>明星</h3>
			<ul>
				<li v-for="item in stars">{{item}}</li>
			</ul>
			<h3>学生列表</h3>
			<ul>
				<li v-for="item in students">
					<h4>{{item.studentName}}</h4>
					<p>年龄{{item.age}}--学校:{{item.school}}</p>
				</li>
			</ul>
			<h3>学生列表(带索引值)</h3>
			<ul>
				<li v-for="item,key in students">
					
					<h4>索引:{{key}}--学生名字:{{item.studentName}}</h4>
					<p>年龄{{item.age}}--学校:{{item.school}}</p>
				</li>
			</ul>
			<h3>循环对象</h3>
			<ul>
				<li v-for="item,key in students[0]">
					key:{{key}}----value:{{item}}
				</li>
			</ul>
			<img :src="students[0].imageHeader" />
			<h3>条件+循环渲染(将偶数年龄的学生渲染出来)</h3>
			<ol>
				<li v-for="item,index in students" v-if="item.age%2==0">
					<h4>索引值:{{index}}--学生名字:{{item.studentName}}</h4>
					<p>年龄{{item.age}}--学校:{{item.school}}</p>
				</li>
			</ol>
		</div>
		<script type="text/javascript">
			var app=new Vue({
				el:"#app",
				data:{
					stars:['蔡徐坤','任贤齐','李小龙','库克'],
					students:[
						{
						studentName:"张三",age:16,school:"12",
						imageHeader:"https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=944544401,1288717384&fm=11&gp=0.jpg"
					},
					{
						studentName:"李四",age:17,school:"13"
					},
					{
						studentName:"王二",age:18,school:"15"
					},
					{
						studentName:"王一",age:19,school:"15"
					}
					],
					
				}
			})
		</script>
	</body>
</html>
